<meta charset="utf-8">
<div class="box box-primary" id="pmpRequires_addRequire"
	style="max-width: 1200px;">
	<form role="form" id="editForm" class="form-horizontal">
		<div class="box-body">
			<div class="form-group">
				<label for="name" class="col-sm-2 control-label"> 需求名称</label>
				<div class="col-sm-10">
					<input type="text" name="name" v-model="pmpRequire.name"
						class="form-control" id="name" required />
				</div>
			</div>
			<div class="form-group">
				<label for="detail" class="col-sm-2 control-label"> 需求详情</label>
				<div class="col-sm-10">
					<input type="text" name="detail" v-model="pmpRequire.detail"
						class="form-control" id="detail" required />
				</div>
			</div>
			<div class="form-group">
				<label for="orderNum" class="col-sm-2 control-label"> 排列顺序</label>
				<div class="col-sm-10">
					<input type="number" min="1" name="orderNum"
						v-model="pmpRequire.orderNum" class="form-control" id="orderNum"
						required />
				</div>
			</div>
			<div class="form-group">
				<label for="password" class="col-sm-2 control-label"> 优先级</label>
				<div class="col-sm-10">
					<input type="number" min="1" name="priority"
						v-model="pmpRequire.priority" class="form-control" id="priority"
						required />
				</div>
			</div>
			<div class="form-group">
				<label for="chargeUserId"> 项目负责人</label> <select type="text"
					name="chargeUserId" v-model="pmpRequire.chargeUserId"
					v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpRequire.chargeUserId',firstEmpty:'true'}"
					class="form-control" id="chargeUserId">
				</select>
			</div>

			<div class="box-footer">
				<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
				<button type="button" class="btn btn-info pull-right"
					v-on:click="add">提交</button>
			</div>
	</form>
	<script type="text/javascript">
		var news = new Vue(
				{
					el : '#pmpRequires_addRequire',
					data : {
						pmpRequires : {
							id : null,
							chargeUserId : undefined,
							priority : undefined,
							orderNum : undefined,
							detail : undefined,
							name : undefined
						},
						bus : new Vue(),
					},
					mounted : function() {
						var _this = this;
						var param = zfesLayerEditDg.getLayerParam();//requireId
						_this.pmpRequires.id = param.requireId;
						//_this.initForm();
					},
					methods : {
						add : function() {
							if ($("#editForm").valid()) {
								let _this = this;
								let url = "/pmp/service/pm/pmpRequires/updatePmpRequires";
								zfesAjax
										.ajaxTodo(
												url,
												_this.$data.pmpRequires,
												function(data) {
													alertSwal
															.successText(data.message);
													layer.close(layer.index);
												})
							}
						},
						cancle : function() {
							layer.close(layer.index);
						}
					}
				});
	</script>
</div>
